package top.zackyoung.springboot.entity.base

import com.baomidou.mybatisplus.extension.activerecord.Model
import lombok.Data
import org.springframework.data.annotation.CreatedDate
import org.springframework.data.annotation.LastModifiedDate
import java.util.*
import javax.persistence.GeneratedValue
import javax.persistence.GenerationType
import javax.persistence.Id
import javax.persistence.MappedSuperclass

@MappedSuperclass
abstract class KotlinBaseEntity<T : KotlinBaseEntity<T>> (
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    var id: Long? = 0,
    @CreatedDate
    var createTime: Date? = Date(),
    @LastModifiedDate
    var updateTime: Date? = Date()
): Model<T>()
